;; 最简单的call/cc测试脚本

(define k #f)
(define x '(1 2 3))

(display "原始x的值: ")
(display x)
(display "\n\n")

(display "开始调用call/cc...\n")
(define initial-result
  (call/cc
    (lambda (current-k)
      (display "在lambda中，设置continuation到k\n")
      (set! k current-k)
      (display "返回lambda的结果: #t\n")
      #t)))

(display "call/cc返回后，initial-result的值: ")
(display initial-result)
(display "\n\n")

(display "执行后续代码，计算(cdr x): ")
(display (cdr x))
(display "\n\n")

(display "调用continuation (k #f)...\n")
(define continuation-result (k #f))
(display "continuation调用返回后，continuation-result的值: ")
(display continuation-result)
(display "\n")